package com.demo.collector;

import com.demo.common.Dish;
import com.demo.common.DishUtil;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Test {
    public static void main(String[] args) {
        List<Dish> menu = DishUtil.getDishes();
        List<Dish> dishes = menu.stream().collect(new ToListCollector<>());
        System.out.println(dishes);

        System.out.println(partitionPrimeswithCustomCollector(100).get(true));
    }

    public static Map<Boolean, List<Integer>> partitionPrimeswithCustomCollector(int n) {
        return IntStream.rangeClosed(2, n).boxed().collect(new PrimeNumbersCollector());
    }
}
